#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableHeroModelDisplayOffsetDao:DaoBase<TableHeroModelDisplayOffset>
    {
        public override string GetFileName()
        {
            return "TableHeroModelDisplayOffset.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableHeroModelDisplayOffset>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableHeroModelDisplayOffset model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.ModelId)) UnityEngine.Debug.LogError("数据表id重复:TableHeroModelDisplayOffset->id: " + model.ModelId);
            #endif
            cachePrimaryInt[model.ModelId] = model;
        }
        protected override TableHeroModelDisplayOffset ParseRowData(string[] rowData)
        {
            TableHeroModelDisplayOffset data = new TableHeroModelDisplayOffset();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.ModelId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.ScaleOffset = float.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.ScaleOffsetForTrain = float.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.heroFormationPosOffset = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.heroFormationPosScale = float.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.LadderPosOffset = rowData[5];
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.LadderPosScale = float.Parse(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.CompetitionPosOffset = string.Intern(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.CompetitionScale = float.Parse(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.FashionOffset = rowData[9];
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.FashionScale = float.Parse(rowData[10]);
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.WinnerScale = float.Parse(rowData[11]);
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.WinnerTitlePosOffset = float.Parse(rowData[12]);
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.heroTurnPosOffset = rowData[13];
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.heroTurnPosScale = float.Parse(rowData[14]);
            }
            if (!string.IsNullOrEmpty(rowData[15]))
            {
                data.heroTurnAngle = float.Parse(rowData[15]);
            }
            if (!string.IsNullOrEmpty(rowData[16]))
            {
                data.soulCardOffset = rowData[16];
            }
            if (!string.IsNullOrEmpty(rowData[17]))
            {
                data.soulCardOffsetScale = float.Parse(rowData[17]);
            }
            return data;
        }
    }
}
